Skip to content

build(deps): bump Bun from 1.3.11 to 1.3.13#837

Merged
BYK merged 1 commit intomainfrom
byk/bump-bun-1.3.13
Apr 23, 2026
Merged

build(deps): bump Bun from 1.3.11 to 1.3.13#837
BYK merged 1 commit intomainfrom
byk/bump-bun-1.3.13

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 23, 2026

Summary

Bump Bun 1.3.11 → 1.3.13 (skip 1.3.12, cumulative) and re-test the long-disabled `bytecode: true` compile flag.

Runtime wins from 1.3.13 (no code changes required)

  • 5.5× faster gzip (zlib-ng) — benefits chunk-upload in `src/lib/api/sourcemaps.ts`
  • Source maps 8× less memory, ~1.8 MB smaller compiled binaries (maps are embedded)
  • Cgroup-aware `availableParallelism()` on Linux — benefits `src/lib/scan/` workers under Docker/K8s limits
  • Faster `Bun.stripANSI` / `Bun.stringWidth` (SIMD) — used in markdown/table rendering
  • Runtime 5% less memory (mimalloc v3)
  • Fixes: `process.env` empty under `chmod 111` CWDs; `statx` EPERM under seccomp; ARM64 `fs.promises` hang on Apple Silicon; Linux ELF `.bun` section for zero-I/O standalone startup

Bytecode retry — still broken

Retested `bytecode: true` in `script/build.ts`. On Bun 1.3.13 it still crashes with:

```
TypeError: Expected CommonJS module to have a function wrapper
```

…before any of our code runs. Our esbuild step emits ESM (`format: "esm"` at `script/build.ts:126`), and the bytecode loader mis-caches it as CJS — exactly oven-sh/bun#21097 / #23490, which 1.3.13 did not address. Flag stays off; comment updated to record the retest.

Workarounds left untouched (confirmed still needed)

  • `src/lib/init/stdin-reopen.ts` (POSIX TTY forwarding) — no 1.3.13 fix
  • `src/lib/bspatch.ts` copy-then-mmap — kernel-level (AMFI / ETXTBSY)
  • `spawnWithRetry` EBUSY on Windows — Defender/SmartScreen race, not Bun
  • Identifier-minify disabled (bun#14585) — no fix shipped
  • `autoloadDotenv/Bunfig: false` — intentional hardening
  • `util.getSystemErrorMap` existence check in telemetry
  • CI `bun install` ENOTEMPTY retry on Windows

Changes

File Change
`package.json` `packageManager: bun@1.3.11` → `1.3.13`
`bun.lock` `@types/bun` + `bun-types` 1.3.6 → 1.3.13 (had silently drifted from runtime; `"latest"` wasn't re-resolving on plain `bun install`)
`script/build.ts` Updated bytecode NOTE comment with 1.3.13 retest result
`src/lib/constants.ts` Cosmetic JSDoc `@example` bump
`test/lib/bench/helpers.test.ts` Cosmetic fixture bump

`docs/bun.lock` was a no-op after `bun install`.

Verification (linux-x64)

  • ✅ `bun run typecheck`
  • ✅ `bun run lint` (1 pre-existing warning unrelated to this PR)
  • ✅ `bun run test:unit` — 5777 pass / 0 fail
  • ✅ `bun run test:isolated` — 138 pass / 0 fail
  • ✅ `bun run build` produces working binary; smoke-tested `--version`, `--help`, `init --help`, `org list --help`
  • Startup: 547.5 ± 23.9 ms vs 534.5 ± 11 ms baseline (within noise on this hardware)

Relying on CI matrix for macOS (Darwin-gated `stdin-reopen.ts`) and Windows (`spawnWithRetry` EBUSY path) coverage.

Out of scope

Skip 1.3.12 (cumulative). Wins available on the runtime side without
any code changes: 5.5x faster gzip (zlib-ng) in chunk-upload, source
maps 8x less memory with ~1.8 MB smaller compiled binaries, cgroup-aware
availableParallelism() on Linux, faster stripANSI/stringWidth, mimalloc
v3 for 5% less RSS, plus fixes for process.env under chmod 111 CWDs and
statx EPERM under seccomp.

Also re-tested bytecode: true now that 1.3.13 landed several bun build
--compile fixes. Our ESM bundle still crashes with 'Expected CommonJS
module to have a function wrapper' before user code runs — tracks
oven-sh/bun#21097 / #23490. Comment updated to record the 1.3.13
retest result.

Bumps @types/bun / bun-types in the lockfile from 1.3.6 to 1.3.13 (they
had silently drifted from the runtime since 'latest' wasn't re-resolving
on plain bun install). Cosmetic: updated JSDoc @example and one bench
fixture to reference 1.3.13.
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-837/

Built to branch gh-pages at 2026-04-23 19:20 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

138 passed | Total: 138 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1942 uncovered lines.
✅ Project coverage is 95.3%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.30%    95.30%        —%
==========================================
  Files          284       284         —
  Lines        41348     41348         —
  Branches         0         0         —
==========================================
+ Hits         39404     39406        +2
- Misses        1944      1942        -2
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 1cd5c76 into main Apr 23, 2026
24 checks passed
@BYK BYK deleted the byk/bump-bun-1.3.13 branch April 23, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant